--- 重新选择目标
--- 触发时机必须为攻击前
---@class BuffEffect63 : BaseBuffEffect
BuffEffect63 = ClientFight.CreateClass("BuffEffect63", ClientFight.BaseBuffEffect)
local t = BuffEffect63
---@param fight Fight
---@param buff FighterBuff
function t:action(fight, buff, ...)
    local parameters = {...};
    local effectVal = buff.buffBean.f_BuffEffectValue;
    local target = null;

    if (effectVal[1] == 0 and table.getn(parameters)>= 1 and parameters[1] ) then
    target =  parameters[1];
     elseif (effectVal[1] == 1) then
    target = buff.source;
    end

    if (target == nil) then
        SkillRoleMgr.savePathFile(string.format("[%s][EFFECT]Fighter %s Buff%s 准备添加buff但是目标没有找到,目标类型%s",
    fightframe, buff.targetfighterId, buffmodelId, effectVal[1]
    ));
        return ClientFight.BaseBuffEffect.action(self, fight, buff, ...);

    end
    BuffManager.addBuff(fight, buff.skill, buff.source, target, false, effectVal[1], 1, buffaddParameters);

end

t.New()